Repository navigation
fix(proxy-relay): pause client during tunnel CONNECT selection (#2847) - #4437
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2847. Queue task 5440 (
repo-health-code-pilot, workerrepo-worker-code, Lane E).Problem: after the first-line peek removed its
datalistener,bin/proxy-relay.mjsawaited target selection / tunnel CONNECT with the client socket still flowing — every byte the client sent in that window was silently dropped, truncating multi-segment request bodies and hanging upstreams.Change (
bin/proxy-relay.mjs, +8):client.pause()immediately beforetryTargets(...)for non-health traffic. On success the peeked buffer is written upstream andclient.pipe(upstream)resumes the client, so bytes buffered during CONNECT follow in order; if all targets fail the existing catch destroys the still-paused client./health, CONNECT protocol, and target selection/retry are untouched.This was gated on PR #4137 (#2234), which touched the same handler; #4137 merged 2026-11-02T15:39:58Z, and this branch is based on current
mainafter it (and after PR #4034).Tests (laptop,
node --test):bin/proxy-relay.test.mjs: tunnel proxy delays its CONNECT answer 400ms while the client sends headers, then body chunks during the window; a recording sink asserts the exact byte stream arrives in order. Also covers the/healthfast path (no sink bytes) and a single-segment control. Verified it fails with the pause removed and passes with it.bin/proxy-relay.test.mjs: 2 passed, 0 failed (including the proxy-relay: accepted client connections have no timeout — an idle or partial-line client is held forever (only the upstream CONNECT is timed) #2234 first-line-deadline test).bin/proxy-port.test.mjs: 14 passed, 0 failed.Need help on this PR? Tag
@codesmith-botwith what you need.